A materialized view is a precomputed result that may be used to compute part or all of query instead of computing it from base tables. The use of materialized views to speed up query processing is conventionally known. In the last few years, materialized views have been implemented in commercial database systems. An implementation of materialized views must solve the view matching problem, that is, determining whether a relational expression can be computed from a set of materialized views and, if so, how. Techniques proposed in the literature for solving the view matching problem differ in several respects: (1) class of query expressions considered; (2) class of views supported; (3) class of substitute expressions considered; (4) whether and how multiple substitute expressions are handled; (5) whether bag semantics or set semantics is assumed; and (6) which constraints, if any, are exploited.
A large database may contain hundreds, even thousands, of tables and hundreds of materialized views. A smart system might also cache and reuse results of previously computed queries. Cached results can be treated as temporary materialized views, easily resulting in thousands of materialized views. Current techniques to determine whether and how a subexpression of a query can be computed from a collection of materialized views run very slowly, especially when the number of views is large.
In view of the foregoing, there is a need for systems and methods that overcome the limitations and drawbacks of the prior art.